package cn.dravenxiaokai.client;

import cn.dravenxiaokai.WeatherServiceImpl;
import lombok.extern.slf4j.Slf4j;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * 第二种调用服务的方式
 */
@Slf4j
public class Client2 {
    public static void main(String[] args) throws MalformedURLException {
        URL url = new URL("http://localhost:8080/weatherService?wsdl");
        QName qName = new QName("http://dravenxiaokai.cn/","WeatherServiceImplService");
        Service service = Service.create(url, qName);
        WeatherServiceImpl port = service.getPort(WeatherServiceImpl.class);
        String query = port.query("大江苏");
        String query2 = port.other();
        log.info(query);
        log.info(query2);
    }
}
